<template>
  <svg-icon iconClass="fullscreen" @click="toggle"></svg-icon>
</template>

<script>
import screenfull from 'screenfull'
export default {
  name: 'FullScreen',
  created () {
    console.log('screenfull', screenfull)
  },
  methods: {
    toggle () {
      if (screenfull.isEnabled) {
        screenfull.toggle()
      } else {
        this.$message.error('该浏览器不支持全屏切换')
      }
    }
  }
}
</script>

<style></style>
